<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>C++ Web Framework: CppWebApplication Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">C++ Web Framework
   &#160;<span id="projectnumber">3.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_cpp_web_application-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">CppWebApplication Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>This class is responsible for encapsulating the QCoreApplication, the <a class="el" href="class_cpp_web_server.html" title="The CppWebServer class is a HTTP server, responsable to receive and dispatch the requisitions. ">CppWebServer</a> and configure the server logging mechanism.  
 <a href="class_cpp_web_application.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="cppwebapplication_8h_source.html">cppwebapplication.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a76766ee1be8080db9db6df98e1b9e907"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_cpp_web_application.html#a76766ee1be8080db9db6df98e1b9e907">CppWebApplication</a> (int argc, char *argv[], const QString &amp;serverPath, <a class="el" href="class_filter.html">Filter</a> *filter=nullptr)</td></tr>
<tr class="memdesc:a76766ee1be8080db9db6df98e1b9e907"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a QCoreApplication, a <a class="el" href="class_cpp_web_server.html" title="The CppWebServer class is a HTTP server, responsable to receive and dispatch the requisitions. ">CppWebServer</a> and install the message handler. if the server folder's path was not found in the serverPath, it will look into the executable's folder.  <a href="#a76766ee1be8080db9db6df98e1b9e907">More...</a><br /></td></tr>
<tr class="separator:a76766ee1be8080db9db6df98e1b9e907"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a96a7655a25d2e35ed545cdb7b8d81cc5"><td class="memItemLeft" align="right" valign="top"><a id="a96a7655a25d2e35ed545cdb7b8d81cc5"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_cpp_web_application.html#a96a7655a25d2e35ed545cdb7b8d81cc5">~CppWebApplication</a> ()</td></tr>
<tr class="memdesc:a96a7655a25d2e35ed545cdb7b8d81cc5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys the server dynamically allocated. <br /></td></tr>
<tr class="separator:a96a7655a25d2e35ed545cdb7b8d81cc5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4f105dee5ddd0cb7c6c93917057e850"><td class="memTemplParams" colspan="2">template&lt;typename CONTROLLER &gt; </td></tr>
<tr class="memitem:ab4f105dee5ddd0cb7c6c93917057e850"><td class="memTemplItemLeft" align="right" valign="top">void&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="class_cpp_web_application.html#ab4f105dee5ddd0cb7c6c93917057e850">addController</a> (const QString &amp;url) noexcept</td></tr>
<tr class="memdesc:ab4f105dee5ddd0cb7c6c93917057e850"><td class="mdescLeft">&#160;</td><td class="mdescRight">Hitches a url to a <a class="el" href="class_controller.html" title="The Controller class is responsable to attend a request from a specific url. You will need to create ...">Controller</a>.  <a href="#ab4f105dee5ddd0cb7c6c93917057e850">More...</a><br /></td></tr>
<tr class="separator:ab4f105dee5ddd0cb7c6c93917057e850"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e9f2c789934748d6b7c29ad33e9d7c9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_cpp_web_application.html#a1e9f2c789934748d6b7c29ad33e9d7c9">start</a> ()</td></tr>
<tr class="memdesc:a1e9f2c789934748d6b7c29ad33e9d7c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts the server and QCoreApplication.  <a href="#a1e9f2c789934748d6b7c29ad33e9d7c9">More...</a><br /></td></tr>
<tr class="separator:a1e9f2c789934748d6b7c29ad33e9d7c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This class is responsible for encapsulating the QCoreApplication, the <a class="el" href="class_cpp_web_server.html" title="The CppWebServer class is a HTTP server, responsable to receive and dispatch the requisitions. ">CppWebServer</a> and configure the server logging mechanism. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a76766ee1be8080db9db6df98e1b9e907"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a76766ee1be8080db9db6df98e1b9e907">&#9670;&nbsp;</a></span>CppWebApplication()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">CppWebApplication::CppWebApplication </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>argc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>argv</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"><em>serverPath</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_filter.html">Filter</a> *&#160;</td>
          <td class="paramname"><em>filter</em> = <code>nullptr</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructs a QCoreApplication, a <a class="el" href="class_cpp_web_server.html" title="The CppWebServer class is a HTTP server, responsable to receive and dispatch the requisitions. ">CppWebServer</a> and install the message handler. if the server folder's path was not found in the serverPath, it will look into the executable's folder. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">int</td><td>argc : Main function parameter used to build QCoreApplication. </td></tr>
    <tr><td class="paramname">char</td><td>*argv[] : Main function parameter used to build QCoreApplication. </td></tr>
    <tr><td class="paramname">const</td><td><a class="el" href="class_configuration.html" title="All classes of C++ Web Framework are contained within the namespace CWF. ">Configuration</a> &amp;config : Used to set the parameters of the server. </td></tr>
    <tr><td class="paramname"><a class="el" href="class_filter.html" title="The Filter class works like a filter. You can use this class to validate sessions or measuring runtim...">Filter</a></td><td>*filter : Install a filter for requests on the server. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ab4f105dee5ddd0cb7c6c93917057e850"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab4f105dee5ddd0cb7c6c93917057e850">&#9670;&nbsp;</a></span>addController()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename CONTROLLER &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void CppWebApplication::addController </td>
          <td>(</td>
          <td class="paramtype">const QString &amp;&#160;</td>
          <td class="paramname"><em>url</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Hitches a url to a <a class="el" href="class_controller.html" title="The Controller class is responsable to attend a request from a specific url. You will need to create ...">Controller</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">const</td><td>QString &amp;url : Url name. </td></tr>
    <tr><td class="paramname"><a class="el" href="class_controller.html" title="The Controller class is responsable to attend a request from a specific url. You will need to create ...">Controller</a></td><td>*controller : <a class="el" href="class_controller.html" title="The Controller class is responsable to attend a request from a specific url. You will need to create ...">Controller</a> that will answer requests made to url. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section user"><dt>Example</dt><dd><div class="fragment"><div class="line"><span class="preprocessor">#include &lt;QCoreApplication&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;controllers/helloworldcontroller.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;cwf/cppwebapplication.h&gt;</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[])</div><div class="line">{</div><div class="line">     CWF::CppWebApplication server(argc, argv, <span class="stringliteral">&quot;/PATH_TO_EXAMPLE/server&quot;</span>));</div><div class="line">     server.addUrlController&lt;HelloWorldController&gt;(<span class="stringliteral">&quot;/hello&quot;</span>);</div><div class="line">     <span class="keywordflow">return</span> server.start();</div><div class="line">}</div></div><!-- fragment --> </dd></dl>

</div>
</div>
<a id="a1e9f2c789934748d6b7c29ad33e9d7c9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1e9f2c789934748d6b7c29ad33e9d7c9">&#9670;&nbsp;</a></span>start()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int CppWebApplication::start </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Starts the server and QCoreApplication. </p>
<dl class="section return"><dt>Returns</dt><dd>int : Returns -1 if it fails. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/home/herik/CPPWebFramework/CPPWebFramework/cwf/<a class="el" href="cppwebapplication_8h_source.html">cppwebapplication.h</a></li>
<li>/home/herik/CPPWebFramework/CPPWebFramework/cwf/cppwebapplication.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon May 28 2018 11:09:08 for C++ Web Framework by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
